﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using io = System.IO;
using wf = System.Windows.Forms;
using dw = System.Drawing;
using System.Windows.Forms.Integration;


namespace editor.app
{
    /// <summary>
    /// PropEditWindow.xaml 的交互逻辑
    /// </summary>
    public partial class PropEditWindow : Window
    {
        public PropEditWindow(Dictionary<string, object> objDic)
        {
            InitializeComponent();
            this.LoadConfig1();

            foreach (var key in objDic.Keys)
            {
                tabView.Items.Add(new TabItem
                {
                    Header = key,
                    Content = new WindowsFormsHost
                    {
                        Child = new wf.PropertyGrid
                        {
                            SelectedObject = objDic[key],
                            CommandsVisibleIfAvailable = false
                        }
                    }
                });
            }
        }

        public PropEditWindow(object obj)
            : this(new Dictionary<string, object> { { "default", obj } })
        {
        }
    }
}
